package dao.pojo;

import java.sql.Timestamp;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "quiz", catalog = "makeiteasy")
public class Quiz implements java.io.Serializable {

	// Fields
	private static final long serialVersionUID = 1L;
	private Integer quizId;
	private Teacher teacher;
	private Test test;
	private String quizClasses;
	private String quizName;
	private Timestamp quizCreateDate;
	private Timestamp quizDeadline;
	private Float quizFullScore;
	private Float quizPassScore;

	// Constructors

	/** default constructor */
	public Quiz() {
	}

	/** minimal constructor */
	public Quiz(String quizName) {
		this.quizName = quizName;
	}

	/** full constructor */
	public Quiz(Teacher teacher, Test test, String quizClasses,
			String quizName, Timestamp quizCreateDate, Timestamp quizDeadline,
			Float quizFullScore, Float quizPassScore) {
		this.teacher = teacher;
		this.test = test;
		this.quizClasses = quizClasses;
		this.quizName = quizName;
		this.quizCreateDate = quizCreateDate;
		this.quizDeadline = quizDeadline;
		this.quizFullScore = quizFullScore;
		this.quizPassScore = quizPassScore;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "quizId", unique = true, nullable = false)
	public Integer getQuizId() {
		return this.quizId;
	}

	public void setQuizId(Integer quizId) {
		this.quizId = quizId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "teaId")
	public Teacher getTeacher() {
		return this.teacher;
	}

	public void setTeacher(Teacher teacher) {
		this.teacher = teacher;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "testId")
	public Test getTest() {
		return this.test;
	}

	public void setTest(Test test) {
		this.test = test;
	}

	@Column(name = "quizClasses", length = 16)
	public String getQuizClasses() {
		return this.quizClasses;
	}

	public void setQuizClasses(String quizClasses) {
		this.quizClasses = quizClasses;
	}

	@Column(name = "quizName", nullable = false, length = 100)
	public String getQuizName() {
		return this.quizName;
	}

	public void setQuizName(String quizName) {
		this.quizName = quizName;
	}

	@Column(name = "quizCreateDate", length = 19)
	public Timestamp getQuizCreateDate() {
		return this.quizCreateDate;
	}

	public void setQuizCreateDate(Timestamp quizCreateDate) {
		this.quizCreateDate = quizCreateDate;
	}

	@Column(name = "quizDeadline", length = 19)
	public Timestamp getQuizDeadline() {
		return this.quizDeadline;
	}

	public void setQuizDeadline(Timestamp quizDeadline) {
		this.quizDeadline = quizDeadline;
	}

	@Column(name = "quizFullScore", precision = 12, scale = 0)
	public Float getQuizFullScore() {
		return this.quizFullScore;
	}

	public void setQuizFullScore(Float quizFullScore) {
		this.quizFullScore = quizFullScore;
	}

	@Column(name = "quizPassScore", precision = 12, scale = 0)
	public Float getQuizPassScore() {
		return this.quizPassScore;
	}

	public void setQuizPassScore(Float quizPassScore) {
		this.quizPassScore = quizPassScore;
	}

}